package com.zhuoyian.dl.util;


public class DownloadParameter {
	public final static int TYPE_FILE = 1;
	public final static int TYPE_IMAGE = 2;
	public final static int TYPE_VIDEO = 3;
	public final static int TYPE_APK = 4;
	public final static int TYPE_DEFAULT = 5;
	public final static int STATE_START = 1;
	public final static int STATE_DOWING = 2;
	public final static int STATE_STOP = 3;
	public final static int STATE_COMPLETE = 4;

	
	private String fileName;
	private String localPath;
	private String url;
	private int taskId;
	private long totalSize;
	private long downSize;
	private int downState;
	private float downloadSpeed;

	public DownloadParameter(String url, int dlType, boolean isNewFile) {
		DownloadPathSpec dps = new DownloadPathSpec(url, dlType, isNewFile);
		this.fileName = dps.getName();
		this.localPath = dps.getPath();
		this.url = dps.getUrl();
		this.taskId = TaskId.get();
		this.totalSize = 0;
		this.downSize = 0;
		this.downState = STATE_START;
	}

	public long getTotalSize() {
		return totalSize;
	}

	public void setTotalSize(long totalSize) {
		this.totalSize = totalSize;
	}

	public long getDownSize() {
		return downSize;
	}

	public void setDownSize(long downSize) {
		this.downSize = downSize;
	}

	public int getDownState() {
		return downState;
	}

	public void setDownState(int downState) {
		this.downState = downState;
	}

	public String getFileName() {
		return fileName;
	}

	public String getLocalPath() {
		return localPath;
	}

	public String getUrl() {
		return url;
	}

	public int getTaskId() {
		return taskId;
	}

	public float getDownloadSpeed() {
		return downloadSpeed;
	}

	public void setDownloadSpeed(float downloadSpeed) {
		this.downloadSpeed = downloadSpeed;
	}
	
}
